package com.totem.base.enums;

import lombok.Getter;

import java.util.Objects;

@Getter
public enum OrderTypeEnum {
    GOODS("GOODS"),
    RECHARGE("RECHARGE"),
    FUNDS("FUNDS"),
    SUBSCRIBE("SUBSCRIBE"),
    WITHDRAW("WITHDRAW"),
    CONVERSION("CONVERSION");

    private final String code;

    OrderTypeEnum(String code){
        this.code = code;
    }

    public static OrderTypeEnum byCode(String code) {
        for (OrderTypeEnum e: OrderTypeEnum.values()) {
            if (e.code.equalsIgnoreCase(code)) {
                return e;
            }
        }
        return null;
    }
}
